<%--
  Created by IntelliJ IDEA.
  User: 胡尚杰
  Date: 2022/11/23
  Time: 9:40
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <meta charset="UTF-8">
    <title>管理员界面</title>
    <style>
        html, body {
            width: 100%;
            height: 100%;
            margin: 0;
            padding: 0;
        }

        main {
            height: 100%;
            display: grid;
            grid-template-columns: 150px calc(100% - 150px);
        }

        aside {
            background-color: black;
        }

        nav {
            height: 60px;
            background-color: #FFFFFF;
        }

        article {
            height: 93%;
            margin: 15px;
            border-style: solid;
            border-width: 3px;
            border-color: black;
        }

        a {
            text-decoration: none;
            color: #FFFFFF;
            font-size: 15px;
        }
    </style>
</head>
<body>
<!--
<header>页面页眉</header>
-->

<!--页面主体部分-->
<main>
    <aside style="color: #DDDDDD;font-size:larger"><br>自行车管理系统
        <a href="http://localhost:8080//bikeServlet?action=page2">
            <p style="text-align: center;">
                <br>自行车管理
            </p>
        </a>
        <a href="http://localhost:8080//stationServlet?action=page">
            <p style="text-align: center;">
                <br>租赁站管理
            </p>
        </a>
        <a href="http://localhost:8080//adminServlet?action=page">
            <p style="text-align: center;">
                <br>管理员管理
            </p>
        </a>
        <a href="http://localhost:8080//bikeServlet?action=page">
            <p style="text-align: center;">
                <br>自行车租用统计
            </p>
        </a>
        <a href="http://localhost:8080//rechargeServlet?action=page">
            <p style="text-align: center;">
                <br>充值记录查询
            </p>
        </a>
    </aside>
    <!--页面内容区块-->
    <section>
        <%--<nav>操作导航</nav>--%>
        <hr>
        <article>
            <form action="a4.jsp">
                <p style="font-size: 20px;font-family:楷体;font-weight: bold;">
                    自行车管理
                    <input maxlength="2000" placeholder="请输入您需要搜索的" type="text"
                           style=" text-indent: 10px;margin-left: 900px;" name="find">
                    <input style=" text-indent: 10px;margin-left: 1010px;" type="submit" value="提交">
                </p>
            </form>
            <hr>

            <div style="float: left;margin-left: 10px;width:1080px; height: 455px; ">
                <form action="bikeServlet?action=addBike" method="post" name="form1"
                      onsubmit="return checkform();">
                    添加自行车:
                    <br><br>
                    <table width="100%" border="1" align="center" cellpadding="3" cellspacing="1" bordercolor="#00FFFF"
                           style="border-collapse:collapse">
                        <tr>
                            <td>编号：</td>
                            <td><select name="bianhao" class="zulinzhandian">
                                <option value="bicycle01">bicycle01</option>
                                <option value="bicycle02">bicycle02</option>
                                <option value="bicycle03">bicycle03</option>
                                <option value="bicycle04">bicycle04</option>
                                <option value="bicycle05">bicycle05</option>
                            </select></td>
                        </tr>
                        <tr>
                            <td width="200">类型：</td>
                            <td><input name='leixing' type='text' height="35" value=""
                                       onblur='checkform()' style='border:solid 1px #000000; color:#666666'/>&nbsp;<label/></td>
                        </tr>
                        <tr>
                            <td width="200">品牌：</td>
                            <td><input name='pingpai' type='text' id='xingming' value='' onblur=''
                                       style='border:solid 1px #000000; color:#666666'/></td>
                        </tr>
                        <tr>
                            <td width="200">租金：</td>
                            <td><input name='zujing' type='text'  value='' onblur=''
                                       style='border:solid 1px #000000; color:#666666'/></td>
                        </tr>
                        <tr>
                            <td>所在站点：</td>
                            <td><select name="zulinzhandian" id="zulinzhandian">
                                <c:forEach items="${requestScope.list}" var="station">
                                    <option value="${station.stationName}">${station.stationName}</option>
                                </c:forEach>
                            </select></td>
                        </tr>



                        <tr>
                            <td>&nbsp;</td>
                            <td><input type="submit" name="Submit" value="提交" style='border:solid 1px #000000; color:#666666'/>
                                <input type="reset" name="Submit2" value="重置" style='border:solid 1px #000000; color:#666666'/></td>
                        </tr>
                    </table>
                </form>
            </div>


        </article>
    </section>
</main>
</body>
</html>
<script language=javascript src='js/My97DatePicker/WdatePicker.js'></script>
<script language=javascript src='js/ajax.js'></script>


<script language=javascript>

    function checkform() {

        var yonghumingobj = document.getElementById("yonghuming");
        if (yonghumingobj.value == "") {
            document.getElementById("clabelyonghuming").innerHTML = "&nbsp;&nbsp;<font color=red>请输入用户名</font>";
            return false;
        } else {
            document.getElementById("clabelyonghuming").innerHTML = "  ";
        }
        var yonghumingobj = document.getElementById("yonghuming");
        if (yonghumingobj.value != "") {
            var ajax = new AJAX();
            ajax.post("factory/checkno.jsp?table=zhandianguanliyuan&col=yonghuming&value=" + yonghumingobj.value + "&checktype=insert&ttime=2022-11-23 13:59:59")
            var msg = ajax.getValue();
            if (msg.indexOf('Y') > -1) {
                document.getElementById("clabelyonghuming").innerHTML = "&nbsp;&nbsp;<font color=red>用户名已存在</font>";
                return false;
            } else {
                document.getElementById("clabelyonghuming").innerHTML = "  ";
            }
        }
        var mimaobj = document.getElementById("mima");
        if (mimaobj.value == "") {
            document.getElementById("clabelmima").innerHTML = "&nbsp;&nbsp;<font color=red>请输入密码</font>";
            return false;
        } else {
            document.getElementById("clabelmima").innerHTML = "  ";
        }
        var youxiangobj = document.getElementById("youxiang");
        if (youxiangobj.value != "") {
            if (/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/.test(youxiangobj.value)) {
                document.getElementById("clabelyouxiang").innerHTML = "";
            } else {
                document.getElementById("clabelyouxiang").innerHTML = "&nbsp;&nbsp;<font color=red>必需邮箱格式</font>";
                return false;
            }
        }
        var lianxishoujiobj = document.getElementById("lianxishouji");
        if (lianxishoujiobj.value != "") {
            if (/^1[3|4|5|8][0-9]\d{4,8}$/.test(lianxishoujiobj.value)) {
                document.getElementById("clabellianxishouji").innerHTML = "";
            } else {
                document.getElementById("clabellianxishouji").innerHTML = "&nbsp;&nbsp;<font color=red>必需手机格式</font>";
                return false;
            }
        }

        return true;
    }

    popheight = 450;
</script>